****
****
****	Replication file for NLSY analyses
****
****
****
****	Ojeda, Christopher, and Peter Hatemi
****
****	"Accounting for the Child in the Transmission of Party Identification"
****
****	American Sociological Review
****
****	December 2015
****
****	DOI: 10.1177/0003122415606101
****
****
****
****	TABLE OF CONTENTS:
****
****	+ Read-in Data
****
****	+ Table 1
****		- Perceptual accuracy
****		- Identification with
****		- Congruence table
****
****	+ Page 11 Note
****
****	+ Note about estimation
****
****	+ Table 2
****		- Direct transmission
****		- Perception
****		- Identification
****
****	+ Table 3
****
****	+ Table 4
****		- Trait-to-trait
****		- Perceptual pathway
****		- First differences
****
****	+ Table 5
****		- Trait-to-trait
****		- Perception
****		- Adoption
****
****	+ Page 16 Note
****		- Trait-to-trait
****		- Perceptual Pathway
****
****	+ Endnote 4
****		- Direct transmission
****		- Perception
****		- Adoption
****
****	+ Endnote 5
****



****
**** READ-IN DATA
****

use "insert path and file name here.dta", clear



****
**** TABLE 1 ["Transmission Does Not Occur..."]
****

* perceptual accuracy
gen pa_mom = 0
replace pa_mom = 1 if (pol_msa == pol_coma)
replace pa_mom = . if (pol_msa==. | pol_coma==.)
svy: tab pa_mom

*identification with
gen iw_mom = 0
replace iw_mom = 1 if (pol_coma == pol_csa)
replace iw_mom = . if (pol_coma==. | pol_csa==.)
svy: tab iw_mom

*congruence table 
*(PR = perceive/reject, PA = perceive/adopt, MA = misperceive/adopt, MR = misperceive/reject)
gen con_table = 0
replace con_table = 1 if pa_mom == 1 & iw_mom == 0
replace con_table = 2 if pa_mom == 1 & iw_mom == 1
replace con_table = 3 if pa_mom == 0 & iw_mom == 1
replace con_table = 4 if pa_mom == 0 & iw_mom == 0
replace con_table = . if pa_mom == . | iw_mom == .
label define con_table 1 "PR" 2 "PA" 3 "MA" 4 "MR"
label values con_table con_table
svy: tab con_table



****
**** PAGE 11 NOTE [Distribution of child-reported PID]
****

tab pol_csa [aw=wt_samp08]



****
**** NOTE ABOUT ESTIMATION
****

/*
Below is the most detailed model, which is used to determine the sample size for
all other models; run this first in order to generate "y_hats" that can then be used
to filter out observations with missingness (in order to maintain sample size across
models)
*/

svyset caseid [pw = wt_samp08]
svy: ologit pol_csa pol_msa ///
			race_black race_hisp age08 male ///
			educ_HS_cs educ_college_cs ///
			educ_HS_ms educ_college_ms ///
			minc_ten if pol_hear != ., or
predict y_hat



****
**** TABLE 2 ["Correlations Indicate an Important Role..."]
****

* Direct transmission
cor pol_csa pol_msa [fw=wt_samp08] if y_hat != . & pol_hear != .

* Perception
cor pol_coma pol_msa [fw=wt_samp08] if y_hat != . & pol_hear != .

* Identification
cor pol_coma pol_csa [fw=wt_samp08] if y_hat != . & pol_hear != .





****
**** TABLE 3 ["Characteristics of the HLS..."]
****

sum race_black race_hisp age08 male educ_HS_cs educ_college_cs ///
	educ_HS_ms educ_college_ms mincome08 ///
	[aw=wt_samp08] if y_hat != . & pol_hear != .

	
	
****
**** TABLE 4 ["The Perceptual Pathway Model..."]
****

svyset caseid [pw = wt_samp08]

*Trait-to-trait
svy: ologit pol_csa pol_msa ///
			race_black race_hisp age08 male ///
			educ_HS_cs educ_college_cs ///
			educ_HS_ms educ_college_ms ///
			minc_ten if pol_hear != ., or
			
*Perceptual pathway
svy: ologit pol_csa pol_msa pol_coma ///
			race_black race_hisp age08 male ///
			educ_HS_cs educ_college_cs ///
			educ_HS_ms educ_college_ms ///
			minc_ten if pol_hear != ., or
			
*First differences
prchange, rest(median)
		


****
**** TABLE 5 ["Discussion Affects Children's Ability..."]
****

gen pol_coma_int = pol_coma*pol_hear
gen pol_msa_int = pol_msa*pol_hear

* Trait-to-trait
 svy: ologit pol_csa pol_msa pol_hear pol_msa_int ///
			race_black race_hisp age08 male ///
			educ_HS_cs educ_college_cs ///
			educ_HS_ms educ_college_ms ///
			minc_ten, or
* Perception
svy: ologit pol_coma pol_msa pol_hear pol_msa_int ///
			race_black race_hisp age08 male ///
			educ_HS_cs educ_college_cs ///
			educ_HS_ms educ_college_ms ///
			minc_ten, or
* Adoption
svy: ologit pol_csa pol_msa pol_coma pol_hear pol_coma_int ///
			race_black race_hisp age08 male ///
			educ_HS_cs educ_college_cs ///
			educ_HS_ms educ_college_ms ///
			minc_ten, or


			
****
**** PAGE 16 NOTE ABOUT AGE OF SAMPLE
****	
	
/*
"...we conduct additional analyses by restricting the sample
to adolescents and young adults (i.e., respondents age 16 to 24).
Results using this restricted saple are consistent (i.e. same
direction and significance) with results of the full sample..."
*/	
	
svyset caseid [pw = wt_samp08]

*Trait-to-trait
svy: ologit pol_csa pol_msa ///
			race_black race_hisp male ///
			educ_HS_cs educ_college_cs ///
			educ_HS_ms educ_college_ms ///
			minc_ten if pol_hear != . & age08 <=24, or
			
*Perceptual pathway
svy: ologit pol_csa pol_msa pol_coma ///
			race_black race_hisp male ///
			educ_HS_cs educ_college_cs ///
			educ_HS_ms educ_college_ms ///
			minc_ten if pol_hear != . & age08 <=24, or
prchange, rest(median)
			
			
				
****
**** ENDNOTE 4 [chi square values]
****

* Direct transmission
tab pol_csa pol_msa [fw=wt_samp08] if y_hat != . & pol_hear != ., chi2

* Perception
tab pol_coma pol_msa [fw=wt_samp08] if y_hat != . & pol_hear != ., chi2

* Identification
tab pol_coma pol_csa [fw=wt_samp08] if y_hat != . & pol_hear != ., chi2


		
****		
**** ENDNOTE 5 [results of multinomial logit]
****

svy: mlogit pol_csa i.pol_msa i.pol_coma ///
			race_black race_hisp age08 male ///
			educ_HS_cs educ_college_cs ///
			educ_HS_ms educ_college_ms ///
			minc_ten if pol_hear != .			
